//
//  ZHYYbutton.h
//  ZHYYView
//
//  Created by yuan zhang on 2021/9/15.
//  Copyright © 2021 yuan zhang. All rights reserved.
//


#import <Cocoa/Cocoa.h>


typedef enum {
    
    ZHRectCornerTopLeft     = 1 << 0,
    ZHRectCornerTopRight    = 1 << 1,
    ZHRectCornerBottomLeft  = 1 << 2,
    ZHRectCornerBottomRight = 1 << 3,
    ZHRectCornerAllCorners  = ~0UL
} ZHRectCorner;

typedef enum {
    
    ZHTextAlignmentCenter =0,    //居中
    ZHTextAlignmentLeft,         //左对齐
    ZHTextAlignmentRight         //右对齐
    
}ZHTextAlignment;

typedef enum {
    
    ZHTextUnderLineStyleNone  = 0,     //无下划线
    ZHTextUnderLineStyleSingle,        //单下划线
    ZHTextUnderLineStyleDouble,        //双下划线
    ZHTextUnderLineStyleDeleteSingle,  //单删除线
    ZHTextUnderLineStyleDeleteDouble   //双删除线
    
}ZHTextUnderLineStyle;



@interface ZHYYbutton : NSView

@property (nullable, weak) id target;
@property (nullable) SEL action;

///当鼠标移动到控件时，是否显示"小手"
@property (nonatomic, assign) BOOL isHandCursor;

///圆角
@property (nonatomic, assign) CGFloat radius;
@property (nonatomic, assign) ZHRectCorner rectCorners;

///按钮文字
@property (nonatomic, nullable, strong) NSString *defaultTitle;
@property (nonatomic, nullable, strong) NSString *selectedTitle;


///按钮文字对齐方式
@property (nonatomic, assign) ZHTextAlignment textAlignment;

///按钮文字下划线样式
@property (nonatomic, assign) ZHTextUnderLineStyle textUnderLineStyle;

///按钮文字颜色
@property (nonatomic, nullable, strong) NSColor  *defaultTitleColor;
@property (nonatomic, nullable, strong) NSColor  *selectedTitleColor;
@property (nonatomic, nullable, strong) NSColor  *disabledTitleColor;

///按钮字体
@property (nonatomic, nullable, strong) NSFont   *defaultFont;
@property (nonatomic, nullable, strong) NSFont   *selectedFont;

///当背景图片存在时，背景色无效
@property (nonatomic, nullable, strong) NSImage  *defaultBackgroundImage;
@property (nonatomic, nullable, strong) NSImage  *selectedBackgroundImage;

///当背景图片不存在时，显示背景色
@property (nonatomic, nullable, strong) NSColor  *defaultBackgroundColor;
@property (nonatomic, nullable, strong) NSColor  *selectedBackgroundColor;
@property (nonatomic, nullable, strong) NSColor  *disabledBackgroundColor;

///是否禁用
@property (nonatomic, assign) BOOL status;

@end

